function R = initialization(X, init)   
    n = size(X,2);                        
    if isstruct(init) 
        R  = expectation(X,init);        
    elseif numel(init) == 1               
        k = init;                          
        label = ceil(k*rand(1,n));         
        R = full(sparse(1:n,label,1,n,k,n));              
                                                         
    elseif all(size(init)==[1,n])  
        label = init;
        k = max(label);
        R = full(sparse(1:n,label,1,n,k,n));
    else
        error('ERROR: init is not valid.');
    end
end


